package com.poh.mapper;

import com.poh.pojo.User;
import com.poh.pojo.query.UserQuery;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface UserMapper {
    User userLogin(@Param("userName") String userName, @Param("passWord") String passWord);
    int updateImgByUserId(@Param("userId") int userId, @Param("userImg") String userImg);
    int studentAddCourse(@Param("userId") int userId, @Param("courseId") int courseId);
    List<User> getStudentByCourseId(@Param("courseId") int courseId);
    int deleteUserById(@Param("userId") int userId, @Param("courseId")int courseId);
    List<User> queryStudentLikeStudentName(@Param("courseId") int courseId, @Param("userName") String userName);
    int addStudentToCourse(@Param("userId") int userId, @Param("courseId") int courseId);
    int getCourseIdByInvitationCode(@Param("invitationCode") String invitationCode);
    List<User> listUserByName(UserQuery userQuery);
    String getUserNameById(@Param("userId") int userId);
    int addUser(User user);
    int updateUserById(User user);
    List<User> getAllStudent();
    User getUserById(@Param("userId")int userId);
}
